package com.chidopi.market.bookstore.domain;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Book2City {
	private static Logger logger = LoggerFactory.getLogger(Book2City.class);
	private Integer book_id;
	private String bookname;
	private Integer city_id;
	private String enable_flag;
	private Float sale_price;
	private Integer subscribe_quota;
	private String bookmark;
	public Book2City(){
		
	}
	
	public Book2City(String [] values){
		book_id = Integer.parseInt(values[0]);
		if(values[1] != null && values[1].trim().length() > 0)
		    sale_price = Float.parseFloat(values[1].trim());
		if(values[2] != null && values[2].trim().length() > 0)
		    subscribe_quota = Integer.parseInt(values[2].trim());
		enable_flag = values[3];
		logger.debug("values.length={}", values.length);
		if (values.length == 5) {
			logger.debug("values[4]={}", values[4]);
			this.bookmark = values[4];
		} else
			this.bookmark = "";
	}
	
	public Integer getBook_id() {
		return book_id;
	}
	public void setBook_id(Integer book_id) {
		this.book_id = book_id;
	}
	public String getBookname() {
		return bookname;
	}
	public void setBookname(String bookname) {
		this.bookname = bookname;
	}
	public Integer getCity_id() {
		return city_id;
	}
	public void setCity_id(Integer city_id) {
		this.city_id = city_id;
	}
	public String getEnable_flag() {
		return enable_flag;
	}
	public void setEnable_flag(String enable_flag) {
		this.enable_flag = enable_flag;
	}
	public Float getSale_price() {
		return sale_price;
	}
	public void setSale_price(Float sale_price) {
		this.sale_price = sale_price;
	}
	public Integer getSubscribe_quota() {
		return subscribe_quota;
	}
	public void setSubscribe_quota(Integer subscribe_quota) {
		this.subscribe_quota = subscribe_quota;
	}

	@Override
	public String toString() {
		return  book_id + ";" + sale_price + ";" + subscribe_quota + ";" + enable_flag;
	}

	public String getBookmark() {
		return bookmark;
	}

	public void setBookmark(String bookmark) {
		this.bookmark = bookmark;
	}
}
